<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>后台管理系统</title>
        <meta name="author" content="BaiYY"/>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="renderer" content="webkit">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/Font/css/font-awesome.min.css"/>
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/index.css"/>
        <script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
        <script type="text/javascript" src="__PUBLIC__/admin/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="__PUBLIC__/admin/js/index.js"></script>
        <script type="text/javascript" src="__PUBLIC__/admin/js/time.js"></script>
        <script type="text/javascript" src="__PUBLIC__/admin/js/bootstrap-paginator.js"></script>
    </head>
    <body>
        <div class="right-sidebar" style="max-width: 1200px;">
            <ul class="nav nav-tabs" style="margin-bottom: 16px" role="tablist">
                <li role="presentation" class="active"><a href="withdrawReview.html">提现审核</a></li>
                <li role="presentation"><a href="uwithdrawList.html">提现记录</a></li>
            </ul>

            <div class="panel panel-default">
                <div class="panel-heading"style="background-color: #eee">
                    <h3 class="panel-title">用户提现方式</h3>
                </div>
                <div class="panel-body" style="padding: 0px;">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="input-group">
                                <input type="hidden" value="{$ids}" id="ids" >
                                <span class="input-group-addon">申请人&emsp;</span>
                                <input type="text" class="form-control" name="user_id" id="user_id" disabled="true" value="{$user_id}">
                                <input type="hidden" id="hiddens"/>
                            </div>
                            <div class="input-group" id="paymethod">
                                <span class="input-group-addon">提现方式</span>
                                <input type="text" class="form-control" disabled="disabled">
                            </div>
                            <div class="input-group">
                                <span class="input-group-addon">真实姓名</span>
                                <input type="text" class="form-control" name="name" id="name" disabled="disabled">
                            </div>
                            <div id="bank_name" style="display: none;">
                                <div class="input-group">
                                    <span class="input-group-addon">开户银行</span>
                                    <input type="text" class="form-control" name="bank_name" disabled="disabled">
                                </div>
                            </div>
                            <div class="input-group" id="payment">
                                <span class="input-group-addon"></span>
                                <input type="text" class="form-control" name="payment"  disabled="disabled" >
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="btngroup">
                <button type="button" class="btn btn-primary" id="sbtn">确认</button>
            </div>

            <div id="bg-models">
                <div id="bg-contents">
                    <i class="glyphicon glyphicon-remove" id="btn-closed"></i>
                    <div class="title_dialog">系统提示！</div>
                    <div class="discription_dialog">您已给他转账了么？</div>
                    <div class="footer_dialog">
                        <button class="btn btn-primary" id="btn-ok">确定</button>
                        <button class="btn btn-primary" id="btn-off">取消</button>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                var ids = $.trim($("#ids").val());
                $.ajax({
					type:"post",
					url:"{:U('Admin/Main/withdrawReviewShow')}?id="+ids,
					success:function(data) {
//						console.log(data);
						$("#user_id").val(data.user_id);
						$("#name").val(data.name);
						$("#payment>input").val(data.payment_no);
						$("#hiddens").val(data.id);
						if(data.payment == 1) {
							$("#paymethod>input").val('支付宝');
							$("#payment span").html('支付宝号');
							$("#bank_name").hide();
						}else if(data.payment == 2) {
							$("#paymethod>input").val('微信');
							$("#payment span").html('微信账号');
							$("#bank_name").hide();
						}else if(data.payment == 3) {
							$("#paymethod>input").val('银行卡');
							$("#payment span").html('银行卡号');
							$("#bank_name").show();
							$("#bank_name input").val(data.bank_name);
						}
					}
				});
            });
            $("#sbtn").on('click',function(){
                var id = $("#hiddens").val();
                $("#bg-models").show();
                $("#btn-ok").on("click",function () {
                    $.ajax({
                        type: "post",
                        url: "{:U('Admin/Main/withdrawReviewSave')}?id="+id,
                        dataType: "json",
                        success: function(data){
                            if (data=='success') {
                                window.location.href="{:U('Admin/Main/withdrawReview')}";
                            }else if (data=='error'){
                                window.location.href="{:U('Admin/Main/withdrawReview')}";
                            }
                        }
                    });
                })
                $("#btn-closed").on("click",function () {
                    $("#bg-models").hide();
                });
                $("#btn-off").on("click",function () {
                    $("#bg-models").hide();
                });
            });
        </script>
    </body>
</html>